OPENNLP-1866: Update Dev Manual on Unicode normalization and the UAX #29 tokenizer (4-docs/7) - #1106
Conversation
|
OPENNLP-1850 stacked PRs (review independently; merge bottom-up, re-targeting each base to
Supersedes #1101. |
1c17110 to
8534bb3
Compare
3037db7 to
9a71f28
Compare
|
Thx for the PR. Here are some suggestions:
Otherwise the content is accurate. |
8534bb3 to
5154da4
Compare
d7d316f to
0ff5d07
Compare
5154da4 to
c51f37d
Compare
667e850 to
d71e472
Compare
40698dc to
001ac01
Compare
b65c0de to
0022bc1
Compare
038e23d to
bc401d3
Compare
0022bc1 to
2fd9543
Compare
bc401d3 to
4c12897
Compare
2fd9543 to
743a955
Compare
|
Status since the last review. Normalizer chapter gains an "Offset-aware pipelines" section for |
3aa333f to
9d8fc27
Compare
1cbc268 to
03912d7
Compare
9d8fc27 to
44442f5
Compare
03912d7 to
52f9281
Compare
44442f5 to
4fd3945
Compare
52f9281 to
125162b
Compare
|
Hi @krickert. I didn't have time to deeply review yet, so here you get some Fable 5 output. Take it with a grain of salt — I will read it next week myself (human in the loop). The good news first: the model cross-checked the docs against the actual code on the branch and found the technical content fully accurate — all constructors/signatures in the samples exist as shown, all 12 Findings (most severe first):
Minor: "lists the 25 characters carrying the White_Space property" will silently go stale on a UCD upgrade; the Catalan middle dot exemption in the bullet-normalizer table would benefit from the one-word reason (U+00B7 occurs inside Catalan words); "adding an unrequested dimension costs one transform" reads as a contradiction until you realize "adding" means "querying at runtime". |
|
@rzo1 addressed all the points in your claude. I'll have copilot do a round as well - cant hurt. |
|
Thanks for improving the docs. |
Lots more coming. |
|
Something looks weird here. There are commits + code changes in a PR that claims to provide the documentation. @krickert Can you verify the branch is up2date with main (-> rebase) and provide it in a clean fashion? |
|
On it let me reproduce it locally and take a look.. Should be pretty quick to do |
|
I had to rebase onto current main after #1105 merged. The branch is now 12 commits, 6 docbook files only (+778/−8). The earlier Java/DL noise was duplicate stack history. It should be gone after the reset/cherry-pick. Sorry about that, that one really did look weird. |
…nd DL handling Add the Text Normalization manual chapter (CharClass engine, normalizer pipeline, the Term model, and the Aligned offset variants that return an AlignedText carrying an Alignment), extend the tokenizer chapter with the UAX #29 segmenter, and document the DL components' Unicode-aware chunking and opt-in whitespace/dash folding with offset-safe findInOriginal. All embedded ONNX snippets are self-contained and compile.
…ligned) Add an "Offset-aware pipelines" section to the normalizer chapter covering TextNormalizer.Builder.buildAligned(), the OffsetAwareNormalizer capability interface, mapping a match back to the source with AlignedText/Alignment, and the fail-loud rejection of rungs that cannot report edits (NFC/NFKC). List the new line-break-preserving whitespace rung in the normalizer family table.
… the manual Document that NameFinderDL.findInOriginal comes from the OffsetMappingNameFinder capability interface, detectable with a plain instanceof check, so the name-finder chapter matches how the normalizer chapter presents OffsetAwareNormalizer.
…gits, ellipsis, bullets, umlaut)
…old options Note in the normalizer manual that, with dash folding enabled, a dash in the supplementary planes shrinks from two UTF-16 units to one and shifts later offsets, so find reports offsets into the normalized text in that case while findInOriginal maps them back to the original input. The one-for-one whitespace fold versus the run-collapsing whitespace rung is already covered in the same section.
Scope the "never relies on Character.isWhitespace" statement to the normalization engine rather than the whole library. Note that getInstance() gives the default shared instance and that case and accent folding also offer configured forms. Refer to the conformance file by its full name WordBreakTest.txt.
…enizer manual The Word Tokenizer section said it drops punctuation and keeps emoji without noting that emoji means any Extended_Pictographic code point, so symbol-like characters such as the copyright, trademark, and double-exclamation signs are kept. Match the WordTokenizer class javadoc.
…d hyphenation Show a concrete, exhaustive ids2Labels BIO mapping in the ONNX name-finder example instead of an empty map (an unmapped predicted index raises IllegalStateException at runtime), and note the exhaustiveness requirement. Hyphenate 'rule-based' and split the comma splice in the UAX #29 tokenizer section.
…ds2Labels example Declare the xlink namespace on the normalizer and tokenizer chapter roots -- both use <link xlink:href=...> (UAX #29 and UTS #39 references) but did not bind the prefix. Populate the ids2Labels map in the second NameFinderDL example (the InferenceOptions/findInOriginal one), which previously left it empty so the example would have located nothing.
…(); drop BM25/search framing Update the Text Normalization chapter examples for the searchDefault()->defaultChain() and searchAnalyzer()->matchingAnalyzer() renames, and drop the 'BM25-style search' phrasing.
…TD catalog form main's OPENNLP-1854 switched every chapter to the local-catalog public id/URL (-//OASIS//DTD DocBook XML 5.0//EN, http://docbook.org/xml/5.0/dtd/docbook.dtd); the new normalizer chapter predated that, so align it so the docs build resolves the DTD locally rather than over the network.
…tary-plane dashes namefinder.xml and doccat.xml stated that whitespace and dash folding both preserve character offsets. That is true for whitespace folding and for Basic Multilingual Plane dashes, but a supplementary-plane dash shrinks from two UTF-16 units to one and shifts later offsets, as the InferenceOptions javadoc and the Text Normalization chapter already document. Rewords both sentences to match and cross-references the normalization chapter's DL section.
Use the UD English sentence model in the ONNX snippet and shorten the InferenceOptions listing so it reuses the setup from the preceding example.
Part 4-docs (7 of 7) of the OPENNLP-1850 stack: Developer Manual coverage of Unicode normalization and the UAX #29 tokenizer — a new "Text Normalization" chapter plus tokenizer / doccat / namefinder / introduction updates and the master
opennlp.xml.Base:
OPENNLP-1850-3-dl(#1105).